import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] spells = new int[n];
        int[] potions = new int[m];
        long success = scanner.nextLong();

        for (int i = 0; i < n; i++) {
            spells[i] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            potions[i] = scanner.nextInt();
        }

        Solution solution = new Solution();
        int[] arr = solution.successfulPairs(spells,potions,success);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        Solution1 solution = new Solution1();
        System.out.println(solution.maximumEnergy(arr, k));
    }
}

class Solution {

    public int[] successfulPairs(int[] spells, int[] potions, long success) {
        int n = spells.length;
        int m = potions.length;
        int[] res = new int[n];
        Arrays.sort(potions);

        for (int i = 0; i < n; i++) {

            long minPotions = (success + spells[i] - 1) / spells[i];

            int l = 0, r = m - 1;
            int start = m;
            while(l <= r){
                int mid = (l + r) / 2;
                if(potions[mid] >= minPotions){
                    start = mid;
                    r = mid - 1;
                }else{
                    l = mid + 1;
                }
            }
            res[i] = m - start;
        }
        return res;
    }
}


class Solution1 {
    public int maximumEnergy(int[] energy, int k) {
        int n = energy.length;
        int[] res = new int[n];
        for (int i = 0; i < k; i++) {
            for (int j = i; j < n; j+=k) {
                res[i] += energy[j];
            }
        }
        for (int i = k; i < n; i++) {
            res[i] = res[i - k] - energy[i - k];
        }
        Arrays.sort(res);
        return res[n - 1];
    }
}